package cn.usian.service.employeeserviceimpl;

import cn.usian.common.R;
import cn.usian.dao.OrdersMapper;
import cn.usian.entity.Orders;
import cn.usian.service.OrdersService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;

@Service
public class OrdersServiceImpl implements OrdersService {
        @Resource
    private OrdersMapper ordersMapper;

    @Override
    public R findPage(Integer page, Integer pageSize, String number, LocalDateTime beginTime, LocalDateTime endTime) {
        Page<Orders> ordersPage = new Page<>(page,pageSize);
        List<Orders>list=ordersMapper.findPage(ordersPage,number,beginTime,endTime);
        ordersPage.setRecords(list);
        return R.success(ordersPage);
    }

    @Override
    public R send(Long id, Integer status) {
        return R.success(ordersMapper.send(id,status));
    }
}
